package com.kjtpay.design_pattern.interpreter;

/**
 * 音速类;TerminalExpression
 */
class Speed extends Expression {
    @Override
    public void execute(String key, double value) {
        String speed = "";
        if (value < 500) {
            speed = "快速";
        } else if (value >= 1000) {
            speed = "慢速";
        } else {
            speed = "中速";
        }
        // 保存解释后的结果，供外部访问
        result = speed;
    }
}
